Skip to content

virtIO: Fail gracefully when unable to push descriptor to wirtqueue message#2163

Open
francescolavra wants to merge 1 commit into
masterfrom
fix/vqmsg_push
Open

virtIO: Fail gracefully when unable to push descriptor to wirtqueue message#2163
francescolavra wants to merge 1 commit into
masterfrom
fix/vqmsg_push

Conversation

@francescolavra
Copy link
Copy Markdown
Member

To gracefully handle out-of-memory conditions, change vqmsg_push() to return a boolean value indicating whether it successfully added the descriptor to the virtqueue message. To avoid the need for callers to always check the return value from vqmsg_push(), add a new parameter to allocate_vqmsg() to specify the number of descriptors that is guaranteed to be available, i.e. the number of subsequent calls to vqmsg_push() that are guaranteed to return a success value.

This fix prevents assertion failures such as in #2133.

…essage

To gracefully handle out-of-memory conditions, change vqmsg_push() to
return a boolean value indicating whether it successfully added the
descriptor to the virtqueue message. To avoid the need for callers to
always check the return value from vqmsg_push(), add a new parameter to
allocate_vqmsg() to specify the number of descriptors that is guaranteed to
be available, i.e. the number of subsequent calls to vqmsg_push() that are
guaranteed to return a success value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant